package com.ljpz.manage.service;

import com.github.abel533.entity.Example;
import com.ljpz.manage.mapper.ItemParamItemMapper;
import com.ljpz.manage.pojo.ItemParamItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by liujunchen on 2016/12/4.
 */
@Service
public class ItemParamItemService extends  BaseService<ItemParamItem> {
    @Autowired
    private ItemParamItemMapper  itemParamItemMapper  ;
    public Integer updateItemParamItem(Long itemId, String itemParams) {
        ItemParamItem  itemParamItem = new ItemParamItem();
        //更新数据
        itemParamItem.setItemId(itemId );
        itemParamItem.setParamData(itemParams);
        itemParamItem.setUpdated(new Date());
        //更新条件
        Example example =  new Example(ItemParamItem.class)  ;
        example.createCriteria().andEqualTo("itemId",itemId)   ;
        return   this.itemParamItemMapper.updateByExampleSelective(itemParamItem, example )  ;
    }
}
